<template>
  <div class="parent">
    <CustomizeEventChildren
      @click="console.log('自定义事件与原生事件名重名')"
      @clickEventB="clickEventBHandler"
    />
  </div>
</template>

<script>
import {defineComponent} from 'vue';
import CustomizeEventChildren from '@/components/CustomizeEventChildren.vue';

export default defineComponent({
  name: 'CustomizeEvent',
  components: {CustomizeEventChildren},
  methods: {
    clickEventBHandler(str, arr) { // 参数与子组件内传递的事件参数对应
      console.log('自定义事件', str, arr); // string ['A', 'B']
    }
  }
});
</script>

<style scoped>
.parent {
  width: 400px;
  height: 400px;
  background: pink;
}
</style>